﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Reader.Core.Application;

namespace Reader.Controllers
{
    public class HomeController : Controller
    {
        private readonly Applications app = new Applications(Program.config);

        public async Task<IActionResult> Main()
        {
            var model = await app.Books.AllBooksAsync();
            return View(model);
        }
        public IActionResult Index()
        {
            ViewData["showBox"]= Program.config.UseFrameless && Program.config.Platform == Chromely.Core.ChromelyPlatform.Windows;
            return View();
        }

        public IActionResult Footer()
        {
            return View();
        }

        //[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        //public IActionResult Error()
        //{
        //    return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        //}
    }
}
